2000W / 48V LLC Battery-Charger  V1.00
StandardTypes.h
Go to the documentation of this file.
1 /**********************************************************/
20 /* Vermeidung rekursiver Einbindungen --------------------*/
21 #ifndef __ISLE_DATATYPES_H
22 #define __ISLE_DATATYPES_H
23 
24 /* Einbindung externer Module (include) ----------*/
25 #include <stdint.h>
26 
27 
28 /**********************************************************/
29 /*** Globale Typen und Strukturen (typedef) ***/
30 /**********************************************************/
31 /* Unsigned Integer Types */
32 typedef uint64_t UI_64; /* 64 Bit -> [0..18'446'744'073'709'551'615] */
33 typedef uint32_t UI_32; /* 32 Bit -> [0..4'294'967'295] */
34 typedef uint16_t UI_16; /* 16 Bit -> [0..65535] */
35 typedef uint8_t UI_8; /* 8 Bit -> [0..255] */
36 
37 /* Signed Integer Types */
38 typedef int64_t SI_64; /* 64 Bit -> [-9'223'372'036'854'775'808 .. +9'223'372'036'854'775'807] */
39 typedef int32_t SI_32; /* 32 Bit -> [-2'147'483'648 .. +2'147'483'647] */
40 typedef int16_t SI_16; /* 16 Bit -> [-32768 .. +32767] */
41 typedef int8_t SI_8; /* 8 Bit -> [ -128 .. +127] */
42 
43 /* Floating Point Types */
44 typedef float F_32; /* 32 Bit (23 Mantisse, 8 Exponent) -> [+/-1,18·10^-38 .. +/- 3,40·10^38] */
45 typedef double D_64; /* 64 Bit (52 Mantisse, 11 Exponent) -> [+/-2,23·10^-308 .. +/- 1,79·10^308] */
46 
47 /* Special Types */
48 /* Boolean */
49 typedef enum
50 {
51  false = 0,
52  true = 1
53 } BOOL; /* 1 Bit -> true, false [1, 0] */
54 
55 /* Union 16-Bit */
56 typedef union
57 {
60  SI_8 s8[2];
61  UI_8 u8[2];
62 } UNION_16;
63 /* Union 32-Bit */
64 typedef union
65 {
68  SI_16 s16[2];
69  UI_16 u16[2];
70  SI_8 s8 [4];
71  UI_8 u8 [4];
72 } UNION_32;
73 /* Union 64-Bit */
74 typedef union
75 {
78  SI_32 s32[2];
79  UI_32 u32[2];
80  SI_16 s16[4];
81  UI_16 u16[4];
82  SI_8 s8 [8];
83  UI_8 u8 [8];
84 } UNION_64;
85 
86 /**********************************************************/
87 /*** Globale Konstanten und Makros (define) ***/
88 /**********************************************************/
89 /* Value-Ranges */
90 #define UI8_MAX ((UI_8)255)
91 #define SI8_MAX ((SI_8)127)
92 #define SI8_MIN ((SI_8)-128)
93 #define UI16_MAX ((UI_16)65535)
94 #define SI16_MAX ((SI_16)32767)
95 #define SI16_MIN ((SI_16)-32768)
96 #define UI32_MAX ((UI_32)4294967295)
97 #define SI32_MAX ((SI_32)2147483647)
98 #define SI32_MIN ((SI_32)-2147483648)
99 #define F32_MAX ((F_32)3.40E+38)
100 #define F32_MIN ((F_32)-3.40E+38)
101 #define D64_MAX ((D_64)1.79E+308)
102 #define D64_MIN ((D_64)-1.79E+308)
103 
104 
105 #endif /* __ISLE_DATATYPES_H */
uint16_t UI_16
Definition: StandardTypes.h:34
uint32_t UI_32
Definition: StandardTypes.h:33
uint64_t UI_64
Definition: StandardTypes.h:32
SI_64 s64
Definition: StandardTypes.h:76
SI_16 s16
Definition: StandardTypes.h:58
int8_t SI_8
Definition: StandardTypes.h:41
uint8_t UI_8
Definition: StandardTypes.h:35
double D_64
Definition: StandardTypes.h:45
UI_64 u64
Definition: StandardTypes.h:77
UI_16 u16
Definition: StandardTypes.h:59
int64_t SI_64
Definition: StandardTypes.h:38
UI_32 u32
Definition: StandardTypes.h:67
int32_t SI_32
Definition: StandardTypes.h:39
int16_t SI_16
Definition: StandardTypes.h:40
BOOL
Definition: StandardTypes.h:49
float F_32
Definition: StandardTypes.h:44
SI_32 s32
Definition: StandardTypes.h:66